package edu.kjxy.worker0322;

import java.util.Scanner;

public class worker06 {

	public static void main(String[] args) {
		int[] monthdays = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
		
		Scanner in = new Scanner(System.in);
		
		int year = in.nextInt();
		int month = in.nextInt();
		int day = in.nextInt();
		in.close();
		if(month < 1 || month > 12) {
			System.out.println("月输入错误！");
			return;
		}
		if(day < 1 || day > monthdays[month]) {
			System.out.println("日输入错误！");
			return;
		}
		
		if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
			monthdays[2] += 1;
		}
//		
//		int res = day;
//		month--;
//		while(month != 0) {
//			res += monthdays[month--];
//		}
		
		int sum = 0;
		for(int i = 0; i < month - 1; i++) {
			sum += monthdays[i];
		}
		sum += day;
		System.out.println("总天数为：" + sum);
	}
}
